<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/2
 * Time: 14:38
 */

namespace App\Http\Requests\Permission;


use App\Http\Requests\ApiRequest;

class SingleRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * 'show'：前端路由
     *
     * @return bool
     */
    public function authorize()
    {
        return self::checkPermission('show');
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => 'required|integer',
            ];
    }

    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'id.required' => '缺少ID',
            'id.integer' => 'ID必须为整数',
            ];
    }
}